<template>
  <ul class="err-list">
    <li v-if="err.dtgy !== 'ok' && err.dtgy !== null">
      <span
        >[
        {{ err.dtgy == "warning" ? "警告" : "" }}
        {{ err.dtgy == "error" ? "故障保护" : "" }} ]</span
      >
      {{ err.dtgy == "warning" ? "单体过压警告" : "" }}
      {{ err.dtgy == "error" ? "单体过压故障" : "" }}
    </li>

    <li v-if="err.dtqy !== 'ok' && err.dtqy !== null">
      <span
        >[
        {{ err.dtqy == "warning" ? "警告" : "" }}
        {{ err.dtqy == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.dtqy == "warning" ? "单体欠压警告" : "" }}
      {{ err.dtqy == "error" ? "单体欠压故障" : "" }}
    </li>

    <li v-if="err.ztgy !== 'ok' && err.ztgy !== null">
      <span
        >[
        {{ err.ztgy == "warning" ? "警告" : "" }}
        {{ err.ztgy == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.ztgy == "warning" ? "总体过压警告" : "" }}
      {{ err.ztgy == "error" ? "总体过压故障" : "" }}
    </li>

    <li v-if="err.ztqy !== 'ok' && err.ztqy !== null">
      <span
        >[
        {{ err.ztqy == "warning" ? "警告" : "" }}
        {{ err.ztqy == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.ztqy == "warning" ? "总体欠压警告" : "" }}
      {{ err.ztqy == "error" ? "总体欠压故障" : "" }}
    </li>

    <li v-if="err.v0err !== 'ok' && err.v0err !== null">
      <span
        >[
        {{ err.v0err == "warning" ? "警告" : "" }}
        {{ err.v0err == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.v0err == "warning" ? "0v禁用警告" : "" }}
      {{ err.v0err == "error" ? "0v禁用故障" : "" }}
    </li>

    <li v-if="err.cdgw !== 'ok' && err.cdgw !== null">
      <span
        >[
        {{ err.cdgw == "warning" ? "警告" : "" }}
        {{ err.cdgw == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.cdgw == "warning" ? "充电过温警告" : "" }}
      {{ err.cdgw == "error" ? "充电过温故障" : "" }}
    </li>

    <li v-if="err.cddw !== 'ok' && err.cddw !== null">
      <span
        >[
        {{ err.cddw == "warning" ? "警告" : "" }}
        {{ err.cddw == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.cddw == "warning" ? "充电低温警告" : "" }}
      {{ err.cddw == "error" ? "充电低温故障" : "" }}
    </li>

    <li v-if="err.fdgw !== 'ok' && err.fdgw !== null">
      <span
        >[
        {{ err.fdgw == "warning" ? "警告" : "" }}
        {{ err.fdgw == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.fdgw == "warning" ? "放电高温警告" : "" }}
      {{ err.fdgw == "error" ? "放电高温故障" : "" }}
    </li>

    <li v-if="err.fddw !== 'ok' && err.fddw !== null">
      <span
        >[
        {{ err.fddw == "warning" ? "警告" : "" }}
        {{ err.fddw == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.fddw == "warning" ? "放电低温警告" : "" }}
      {{ err.fddw == "error" ? "放电低温故障" : "" }}
    </li>

    <li v-if="err.wcgd !== 'ok' && err.wcgd !== null">
      <span
        >[
        {{ err.wcgd == "warning" ? "警告" : "" }}
        {{ err.wcgd == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.wcgd == "warning" ? "温差过大警告" : "" }}
      {{ err.wcgd == "error" ? "温差过大故障" : "" }}
    </li>

    <li v-if="err.jhwdgg !== 'ok' && err.jhwdgg !== null">
      <span
        >[
        {{ err.jhwdgg == "warning" ? "警告" : "" }}
        {{ err.jhwdgg == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.jhwdgg == "warning" ? "均衡温度过高警告" : "" }}
      {{ err.jhwdgg == "error" ? "均衡温度过高故障" : "" }}
    </li>

    <li v-if="err.moswdgg !== 'ok' && err.moswdgg !== null">
      <span
        >[
        {{ err.moswdgg == "warning" ? "警告" : "" }}
        {{ err.moswdgg == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.moswdgg == "warning" ? "mos温度过高警告" : "" }}
      {{ err.moswdgg == "error" ? "mos温度过高故障" : "" }}
    </li>

    <li v-if="err.dzwdgg !== 'ok' && err.dzwdgg !== null">
      <span
        >[
        {{ err.dzwdgg == "warning" ? "警告" : "" }}
        {{ err.dzwdgg == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.dzwdgg == "warning" ? "电阻温度过高警告" : "" }}
      {{ err.dzwdgg == "error" ? "电阻温度过高故障" : "" }}
    </li>

    <li v-if="err.cdgl !== 'ok' && err.cdgl !== null">
      <span
        >[
        {{ err.cdgl == "warning" ? "警告" : "" }}
        {{ err.cdgl == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.cdgl == "warning" ? "充电过流警告" : "" }}
      {{ err.cdgl == "error" ? "充电过流故障" : "" }}
    </li>

    <li v-if="err.hkgl !== 'ok' && err.hkgl !== null">
      <span
        >[
        {{ err.hkgl == "warning" ? "警告" : "" }}
        {{ err.hkgl == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.hkgl == "warning" ? "回馈过流警告" : "" }}
      {{ err.hkgl == "error" ? "回馈过流故障" : "" }}
    </li>

    <li v-if="err.fdgl !== 'ok' && err.fdgl !== null">
      <span
        >[
        {{ err.fdgl == "warning" ? "警告" : "" }}
        {{ err.fdgl == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.fdgl == "warning" ? "放电过流警告" : "" }}
      {{ err.fdgl == "error" ? "放电过流故障" : "" }}
    </li>

    <li v-if="err.yfgl !== 'ok' && err.yfgl !== null">
      <span
        >[
        {{ err.yfgl == "warning" ? "警告" : "" }}
        {{ err.yfgl == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.yfgl == "warning" ? "预放电过流警告" : "" }}
      {{ err.yfgl == "error" ? "预放电过流故障" : "" }}
    </li>

    <li v-if="err.yfdcs !== 'ok' && err.yfdcs !== null">
      <span
        >[
        {{ err.yfdcs == "warning" ? "警告" : "" }}
        {{ err.yfdcs == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.yfdcs == "warning" ? "预放电超时警告" : "" }}
      {{ err.yfdcs == "error" ? "预放电超时故障" : "" }}
    </li>

    <li v-if="err.socgd !== 'ok' && err.socgd !== null">
      <span
        >[
        {{ err.socgd == "warning" ? "警告" : "" }}
        {{ err.socgd == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.socgd == "warning" ? "soc过低警告" : "" }}
      {{ err.socgd == "error" ? "soc过低故障" : "" }}
    </li>

    <li v-if="err.jygd !== 'ok' && err.jygd !== null">
      <span
        >[
        {{ err.jygd == "warning" ? "警告" : "" }}
        {{ err.jygd == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.jygd == "warning" ? "绝缘过低警告" : "" }}
      {{ err.jygd == "error" ? "绝缘过低故障" : "" }}
    </li>

    <li v-if="err.dcdl !== 'ok' && err.dcdl !== null">
      <span
        >[
        {{ err.dcdl == "warning" ? "警告" : "" }}
        {{ err.dcdl == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.dcdl == "warning" ? "电池短路警告" : "" }}
      {{ err.dcdl == "error" ? "电池短路故障" : "" }}
    </li>

    <li v-if="err.dycjyc !== 'ok' && err.dycjyc !== null">
      <span
        >[
        {{ err.dycjyc == "warning" ? "警告" : "" }}
        {{ err.dycjyc == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.dycjyc == "warning" ? "电压采集异常警告" : "" }}
      {{ err.dycjyc == "error" ? "电压采集异常故障" : "" }}
    </li>

    <li v-if="err.wdcjyc !== 'ok' && err.wdcjyc !== null">
      <span
        >[
        {{ err.wdcjyc == "warning" ? "警告" : "" }}
        {{ err.wdcjyc == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.wdcjyc == "warning" ? "温度采集异常警告" : "" }}
      {{ err.wdcjyc == "error" ? "温度采集异常故障" : "" }}
    </li>

    <li v-if="err.nbtx !== 'ok' && err.nbtx !== null">
      <span
        >[
        {{ err.nbtx == "warning" ? "警告" : "" }}
        {{ err.nbtx == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.nbtx == "warning" ? "内部通信异常警告" : "" }}
      {{ err.nbtx == "error" ? "内部通信异常故障" : "" }}
    </li>

    <li v-if="err.ymoserr !== 'ok' && err.ymoserr !== null">
      <span
        >[
        {{ err.ymoserr == "warning" ? "警告" : "" }}
        {{ err.ymoserr == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.ymoserr == "warning" ? "预放电mos警告" : "" }}
      {{ err.ymoserr == "error" ? "预放电mos故障" : "" }}
    </li>

    <li v-if="err.fdmoserr !== 'ok' && err.fdmoserr !== null">
      <span
        >[
        {{ err.fdmoserr == "warning" ? "警告" : "" }}
        {{ err.fdmoserr == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.fdmoserr == "warning" ? "放电mos异常警告" : "" }}
      {{ err.fdmoserr == "error" ? "放电mos异常故障" : "" }}
    </li>

    <li v-if="err.cdmoserr !== 'ok' && err.cdmoserr !== null">
      <span
        >[
        {{ err.cdmoserr == "warning" ? "警告" : "" }}
        {{ err.cdmoserr == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.cdmoserr == "warning" ? "充电mos异常警告" : "" }}
      {{ err.cdmoserr == "error" ? "充电mos异常故障" : "" }}
    </li>

    <li v-if="err.dcsm !== 'ok' && err.dcsm !== null">
      <span
        >[
        {{ err.dcsm == "warning" ? "警告" : "" }}
        {{ err.dcsm == "error" ? "故障保护" : "" }}]</span
      >
      {{ err.dcsm == "warning" ? "电池寿命中止警告" : "" }}
      {{ err.dcsm == "error" ? "电池寿命中止故障" : "" }}
    </li>
  </ul>
</template>

<script>

export default {
  props: {
    err: {
      type: Object,
      default: {},
    },
  },
  mounted() {
    console.log(this.err);
  },
  methods: {},
};
</script>

<style scoped>
.err-list {
  width: 100%;
  padding: 0;
  margin: 0;
  list-style: none;
}
.err-list li {
  width: 100%;
  font-size: 14px;
  line-height: 2;
}
.err-list li span {
  color: #f00;
}
</style>
